package bma.common.mq.outer.service;

import org.apache.thrift.TException;

import bma.common.mq.outer.po.SEND_RESULT;
import bma.common.mq.outer.thrift.TMQService;
import bma.common.mq.outer.thrift.TMessageInfo;
import bma.common.mq.outer.thrift.TSendMessageResult;
import bma.common.langutil.log.filelog.AsyncFileLog;

/**
 * 
 * @author cuiling
 *
 */
public class MQServiceThrift implements TMQService.Iface{
	
	final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(MQServiceThrift.class);

	private AsyncFileLog fileLog;

	public void setFileLog(AsyncFileLog fileLog) {
		this.fileLog = fileLog;
	}
	
	private ReceiveServiceImpl receiveService;

	public void setReceiveService(ReceiveServiceImpl receiveService) {
		this.receiveService = receiveService;
	}

	@Override
	public TSendMessageResult sendMessage(TMessageInfo msgInfo) throws TException {
		SEND_RESULT result= receiveService.receiveMessage(msgInfo); 
		return new TSendMessageResult(result.getCode(),result.getMsg());
	}
	



}
